function myRequest(options) {
  let token = wx.getStorageSync('token');
  if (!options.url) {
    return false;
  }
  let method;
  if (!options.method){
    method = options.method
  }else{
    method = options.method.toUpperCase()
  }
  wx.request({
    url: options.url,
    data: options.data || {},//请求参数。默认为空
    method: method || 'GET', //请求方式
    header: {
      'X-Nideshop-Token': token
    }, // 设置请求的 header
    success: options.success,
    fail: options.fail,
    complete: options.complete
  })
}

module.exports = {
  myRequest: myRequest,
}